package com.liangsong.designpattern.chain;

public class ClassAdviser extends Approver{
    public ClassAdviser(String name, Approver nextApprover) {
        super(name, nextApprover);
    }

    @Override
    public void Approve(LeaveRequest leaveRequest) {
        if (leaveRequest.getDays()==1) {
            leaveRequest.setStatus(true);
            System.out.println("班主任:"+getName()+" Approve "+leaveRequest.getRequestName()+leaveRequest.getDays()+"天的请求");
        }
        else
            getNextApprover().Approve(leaveRequest);
    }
}
